UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4eHv5ppvPlVwq3kp3ZcWlSXj/YEVK92QfVBWvwkG5Hw=' 
WHERE 
  key_id = '5e1c1dd761aa9edda1f44091f09755c2878957923a3acbfed03fe4088313e705' 
  AND (
    token = '4eHv5ppvPlVwq3kp3ZcWlSXj/YEVK92QfVBWvwkG5Hw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037