UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uXv9mA7DLkoIF3NHb7kVbKMyvQysdOWeS8GW9mJjMBI='
WHERE
key_id = '548c6344a847fc59ca7414ef00e8f67acb66f002ca2def93ac2d1c877647a89e'
AND (
token = 'uXv9mA7DLkoIF3NHb7kVbKMyvQysdOWeS8GW9mJjMBI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)