UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ueu4MGxfKTtIst8wPZGHs0mfnx5+R2z62qNaSEPzq+4='
WHERE
key_id = '265f6098ad8f31b172a0b18f9f17f40675d58d3adcb92e91cccbc2ef021865eb'
AND (
token = 'Ueu4MGxfKTtIst8wPZGHs0mfnx5+R2z62qNaSEPzq+4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)