UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XUZpJVx+Es2GERqNFZQ9A8lc9EcKf06bOWvKjnn/J7o=' 
WHERE 
  key_id = 'ff8d0dcd6ee5e8316874d169c32b5de90aab9e6bc94acad7e948564993887653' 
  AND (
    token = 'XUZpJVx+Es2GERqNFZQ9A8lc9EcKf06bOWvKjnn/J7o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031