UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Sf4mvj/0oSFwjIoFuR14vsOFw6MZ2vJTlyygbsY0pXk='
WHERE
key_id = '64b0b7b67638d19b9555e7b09f56127301733ebc022700970e36c092d67df6dd'
AND (
token = 'Sf4mvj/0oSFwjIoFuR14vsOFw6MZ2vJTlyygbsY0pXk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)