UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xpeP5gRueq4UZK18mgQ5ss464NeDieMbV/ZUC9O6fUA=' 
WHERE 
  key_id = 'd1ccbfd8a49b1ab15166c6a014ddfb74bca6c4602a1ba3b8cb05649f69638348' 
  AND (
    token = 'xpeP5gRueq4UZK18mgQ5ss464NeDieMbV/ZUC9O6fUA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039