UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UYshzx6AwhpeVKHXr7gu4p7zrYZlHHc2umWAZ40KiyQ=' 
WHERE 
  key_id = 'f363ddbdb621595b485c5b0f72bf01dadfd6a9886c3a440aece98ef455da4b81' 
  AND (
    token = 'UYshzx6AwhpeVKHXr7gu4p7zrYZlHHc2umWAZ40KiyQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045