UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9Pop6DdjukcHBOQwKPjNEK+3kluuAv0xOAEVztBUxxI=' 
WHERE 
  key_id = 'acdfec67acc5b04f3847828d100230525519b1573abf24b2bd4675ac8956654a' 
  AND (
    token = '9Pop6DdjukcHBOQwKPjNEK+3kluuAv0xOAEVztBUxxI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00076