UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U7F9yQ/mv9SFzoxJziKWrE/PKylKIF88kK8RKv9leeU=' 
WHERE 
  key_id = '916253059f948ce139689088a43459f0462a509e28d53946584854307edd22d3' 
  AND (
    token = 'U7F9yQ/mv9SFzoxJziKWrE/PKylKIF88kK8RKv9leeU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00063