UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hvmzlSQkP7o/Ht0ZEFvz1XzwqzypEO0WcT6eIW2aDDM='
WHERE
key_id = 'ffce25937eeb01b04b92ccf505168cf4574aa22f87878be0fceb2e103d209f60'
AND (
token = 'hvmzlSQkP7o/Ht0ZEFvz1XzwqzypEO0WcT6eIW2aDDM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)