UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nu6kQeKpzoswezdmlPFMTAwJPtS1wSCa1pHYKhO7l58=' 
WHERE 
  key_id = '346022c3171d211aac37ce4636402087780493f9a03e7fc7623ce6f069aa6369' 
  AND (
    token = 'nu6kQeKpzoswezdmlPFMTAwJPtS1wSCa1pHYKhO7l58=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047