UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SYJA3kOsELD8QmenuRFjIS2QHaXtkNx9CZ5nL2PqQDI='
WHERE
key_id = 'e525309faf99631d41426f85e061c34024d728796b28d044d41e5e7f7d2498a0'
AND (
token = 'SYJA3kOsELD8QmenuRFjIS2QHaXtkNx9CZ5nL2PqQDI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)