UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rmhbJ7HrqoMtCGPNvZWo1OLUI2rITo0UrgzioEOY7QE='
WHERE
key_id = '06e51068ee44297d402101c3c359cf1c891198ac426c679e41e6f11a0743d439'
AND (
token = 'rmhbJ7HrqoMtCGPNvZWo1OLUI2rITo0UrgzioEOY7QE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)