UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LihFL1T3lV89OZx88rp9B8371oTE7zk5qNZMbif0noI='
WHERE
key_id = '4cdc7151e19e584aabaa0e01f80dfdd5884ae6bb01e6fcdd836b61e0d5d83d6c'
AND (
token = 'LihFL1T3lV89OZx88rp9B8371oTE7zk5qNZMbif0noI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)