UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Fmg0Je6EEc5HFo9dI/y1N5AMsuHFrq5Nk16xgJtUHIU=' 
WHERE 
  key_id = 'c1260423e152a043d14e1be80afb534ea6afac4528032ec680a2939404ddbbb0' 
  AND (
    token = 'Fmg0Je6EEc5HFo9dI/y1N5AMsuHFrq5Nk16xgJtUHIU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028