UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OHornEqDRQ4eG/5ZWbtZOL+R9tNEomG5Vnl9XPPuQIE=' 
WHERE 
  key_id = 'da61bb5cf24f92ae2a719019a0dcbe464faf737a11a0d222784f90c2f7425b52' 
  AND (
    token = 'OHornEqDRQ4eG/5ZWbtZOL+R9tNEomG5Vnl9XPPuQIE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040