UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M1tkuR5J59LajsBskTz/at3e0adppM341zgCi3ABDfg='
WHERE
key_id = '3f2053b05cfab0aada2ef02def99bbc3ece1259105ad05205b6c97912d722580'
AND (
token = 'M1tkuR5J59LajsBskTz/at3e0adppM341zgCi3ABDfg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)