UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yY6bZBZPTwYnWvJON0tmP4P2TM/tDESKOVa+FXNxn9o=' 
WHERE 
  key_id = '640b0f7ff7cc71f50f916245160cebfa4fc413528507277c88b9ed1b5b8c60aa' 
  AND (
    token = 'yY6bZBZPTwYnWvJON0tmP4P2TM/tDESKOVa+FXNxn9o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037