UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TdOEr7Kfu7ev77fDij6MocodNRJNtH6gnKcrziG0+Ws='
WHERE
key_id = '3bf09e9044d842a7b2cead8ee21ce5d9dfa94a748d3f62e8bfa035d979daadc9'
AND (
token = 'TdOEr7Kfu7ev77fDij6MocodNRJNtH6gnKcrziG0+Ws='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)