UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yW4HzpPO79bGMzVWshf6rfGWNI+FTNukdOE3Y+HIYOw=' 
WHERE 
  key_id = '05e4a5e7b33e4af7aa05c2dc8a9bb3945194ba77e0f7eafc3763a819341f8f4e' 
  AND (
    token = 'yW4HzpPO79bGMzVWshf6rfGWNI+FTNukdOE3Y+HIYOw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030