UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0RXUXzrnMqZ6lp3TWW+uwmCVlEPQX297FgpF4LF1LMo=' 
WHERE 
  key_id = 'c9a78b435229f6df02a5204e936b396d744aceeda7a2905f51a44491e387d467' 
  AND (
    token = '0RXUXzrnMqZ6lp3TWW+uwmCVlEPQX297FgpF4LF1LMo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050