UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nHNPbR/exDqlW7oYCpkgaShdEDahwtnlyZ946dLkcdc=' 
WHERE 
  key_id = '753cb24da492c0be9bde2ae9cbeb3b2d49bc16d55ba0c48fb0aa3900030e41ac' 
  AND (
    token = 'nHNPbR/exDqlW7oYCpkgaShdEDahwtnlyZ946dLkcdc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025