UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wFSf+PZvBYAdaXAV4Z0NwDTTo5di7gVvt6XZwoXDHgE='
WHERE
key_id = 'f4c50b5f7a8709fe1610a0dce928639124f86002bd53954abaac197d9936d496'
AND (
token = 'wFSf+PZvBYAdaXAV4Z0NwDTTo5di7gVvt6XZwoXDHgE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)