UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Qrrto73372wevbQ1/r2Gkz1QDwekuF+ErnB5EvMGMqk='
WHERE
key_id = 'bf220af97540d3029eb29b86e428184295afc33c5ca9be2d6411f6a3adb7f0ac'
AND (
token = 'Qrrto73372wevbQ1/r2Gkz1QDwekuF+ErnB5EvMGMqk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)