UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'T0CbHAEAplUtQVQP9yYws2TF72OU/Mdi5p0vnOVzppQ='
WHERE
key_id = '0513200d37850c3f836ca6d2c9227f516c739060d630c14755cb077b6a3e10b3'
AND (
token = 'T0CbHAEAplUtQVQP9yYws2TF72OU/Mdi5p0vnOVzppQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)