UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+kZz8TojmQbORh1RC6RlcSuC9fU+rg/ngU1hdyB+HNE='
WHERE
key_id = '539de0e7e3f10cf032d272ca63674cb09e0935d18aab04cd091df30b0c5baa3f'
AND (
token = '+kZz8TojmQbORh1RC6RlcSuC9fU+rg/ngU1hdyB+HNE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)