UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QIs+ZTsRcEL8DRvyYYpM/JfsK+OoKqG9SdV425/UR3o='
WHERE
key_id = 'fb8fb8b26f8e810175f0e281274e1690c7ef5c6610a33293c5d8aa6177c80a89'
AND (
token = 'QIs+ZTsRcEL8DRvyYYpM/JfsK+OoKqG9SdV425/UR3o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)