UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4oQTKgzwmE86oLHTeG2OS8zrUXzr7GWzK7mVsM0gMcU=' 
WHERE 
  key_id = 'a343a17c2f2135b33b5b58eea7c2cbf5d6951da361cc7cc8274c8f234c62fa01' 
  AND (
    token = '4oQTKgzwmE86oLHTeG2OS8zrUXzr7GWzK7mVsM0gMcU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034