UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Xr98T/CLI7QlpDtkJQUe6xiTNoj/8S/0lIm70LueH5Y='
WHERE
key_id = '6fde2a73b62e857b4ad351b035c3426a62e6500ae0e3afaa162710755bb2839a'
AND (
token = 'Xr98T/CLI7QlpDtkJQUe6xiTNoj/8S/0lIm70LueH5Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)