UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5m5XDlyo6OO+O0gNTGQEsR6LLep3Iw/ama2O8walOIY=' 
WHERE 
  key_id = 'c235c990111ba3df5f292cdd420c428d86575ba484139f948fdfe8d19e888bca' 
  AND (
    token = '5m5XDlyo6OO+O0gNTGQEsR6LLep3Iw/ama2O8walOIY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040