UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sV8Ft1wmQnrp93hakFXvl4Mk+Z90mGcvUfuWUoMwvvU='
WHERE
key_id = '880518f1b155c2269035573b9f4af3a3296a8842d3e0714d1f55f0a4468ba37f'
AND (
token = 'sV8Ft1wmQnrp93hakFXvl4Mk+Z90mGcvUfuWUoMwvvU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)