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