UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lQD4qyBrZVzhM9VmzdReua7AHgFLIaXP7tRW6xMVFpc='
WHERE
key_id = 'cb48ca60d874829c74a9cdb21dff6dfa04529c2460ae25bf983bfd8ea34917b6'
AND (
token = 'lQD4qyBrZVzhM9VmzdReua7AHgFLIaXP7tRW6xMVFpc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)