UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TfhTcm0nvFOp84SxsteD+VL+nMvggDjA5c0Neg7toi0='
WHERE
key_id = '1e37fbc4b4d21be12f9751f1ff2c2a2c62ffbb777a3b80405c67fcdd941b0dfa'
AND (
token = 'TfhTcm0nvFOp84SxsteD+VL+nMvggDjA5c0Neg7toi0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)