UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '45F3mhz/P0RpjgINbV4TigBrOBlMP4iN6Yhp2iKxe2k='
WHERE
key_id = 'ff82c61ab050455b85646b74db488dec3d7c6430ed8db149f602a12936e6390e'
AND (
token = '45F3mhz/P0RpjgINbV4TigBrOBlMP4iN6Yhp2iKxe2k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)