UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7cY+qfLj5NTovaCRAyduxPjzjxXT8vDieCXT/wdZh+I='
WHERE
key_id = 'add5c8c198c43c962d54bdd9110957f06619ab77fba90937b414a0b2684da84b'
AND (
token = '7cY+qfLj5NTovaCRAyduxPjzjxXT8vDieCXT/wdZh+I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)