UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RvbZeH2POz4tGckUB5rrsRQB0Hbyz5Ipokj1zaX4s34='
WHERE
key_id = '69f2eb52782f4b427b033b25e62ff8797daf5e8b7aec25f9f2436be40c91b5aa'
AND (
token = 'RvbZeH2POz4tGckUB5rrsRQB0Hbyz5Ipokj1zaX4s34='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)