UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'df0k9CMW/oHdI1nfWdIw3JlrjeWpMhYxW1977o3zOp0='
WHERE
key_id = 'f750fbd392a8f302d442b38c3aa4dc06938dad8c46de21e953d091acf7e5c962'
AND (
token = 'df0k9CMW/oHdI1nfWdIw3JlrjeWpMhYxW1977o3zOp0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)